
//登录的点击事件
$("#Lsubmit").click(function() {
	
	$.ajax({
		type: "get",
		url:"http://127.0.0.1/yh/selectUser",
				async:true,
				data: {
				"userName":$("#loginuserName").val(),
				"pwd":hex_md5($("#loginpwd").val())
				},
				dataType: "json",
				success: function(data){
					//alert("进来了")
					if(data.code==0){
						window.location.href="../index.html"
					}else if(data.code==-1){
						alert(data.msg);
					}
				}
	});
})

//注册的点击事件
$("#Rsubmit").click(function(){
	
	$.ajax({
		type: "post",
		url:"http://127.0.0.1/yh/insertUser",
				async:true,
				data: {
				"userName":$("#ruserName").val(),
				"pwd":hex_md5($("#rpwd").val()),
				"name":$("#rname").val(),
				"sex":$("#rsex").val(),
				"u_type":$("#ru_type").val(),
				"birthday":$("#rbirthday").val(),
				"inTime":$("#rinTime").val(),
				"phone":$("#rphone").val(),
				"email":$("#remail").val(),
				},
				dataType: "json",
				success: function(data){
					if(data.code==0){
						alert(data.msg)
						window.location.href="login.html"
					}else{
						alert(data.msg)
					}
				}
	});
})